package com.jk.vehicle.mini.config;

import com.jk.vehicle.mini.intercept.SmartDashboardInterceptor;
import com.jk.vehicle.core.config.JhWebMvcConfigurer;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.servlet.config.annotation.InterceptorRegistry;

import java.util.ArrayList;
import java.util.List;

/**
 * 扩展webmvc配置
 *
 * @author KangJian
 * @date 2018/10/20
 */
@Configuration
public class HRWebMvcConfig extends JhWebMvcConfigurer {
	@Override
	public void addInterceptors(InterceptorRegistry registry) {
		registry.addInterceptor(getInterceptor());
	}

	/**
	 * 用户登录拦截器
	 * @return
	 */
	@Bean
	public SmartDashboardInterceptor getInterceptor() {
		List<String> uncheckUrls = new ArrayList<>();

		// uncheckUrls.add("/cooout/user/register");

		return new SmartDashboardInterceptor(uncheckUrls);
	}
}
